<?php
    //If date has the default value, it is turned to current time.
    if($date == 'dd.mm.yyyy')
    {
        $date = time();
    }

    //If the date is not default, we try to parse it to timestamp.
    elseif(strtotime($date))
    {
        $date = strtotime($date);
    }

    //If date can't be converted to timestamp, an error has occured.
    else 
    {
        $_POST['error']['date'] = TRUE;
    }
?>